package com.example.peng.mycallback;

import android.util.Log;

import cn.finalteam.okhttpfinal.BaseHttpRequestCallback;
import okhttp3.Headers;
import okhttp3.Response;

/**
 * Created by peng on 2017/5/22.
 */

public class BaseRequestCallBack<T> extends BaseHttpRequestCallback<T> {
    private String tag = "MyOkTag";
    private boolean isShowDialog = false, isShowFailMsg = false;

    public BaseRequestCallBack() {
        super();
    }

    public BaseRequestCallBack(boolean isShowDialog, boolean isShowFailMsg) {
        super();
        this.isShowDialog = isShowDialog;
        this.isShowFailMsg = isShowFailMsg;
    }

    @Override
    public void onStart() {
        Log.i(tag, "onStart..");
    }

    @Override
    protected void onSuccess(T t) {
        Log.i(tag, "onSuccess..");
    }

    @Override
    public void onFailure(int errorCode, String msg) {
        Log.i(tag, "onFailure.." + " errorCode = " + errorCode + " msg = " + msg);
    }

    @Override
    public void onResponse(Response httpResponse, String response, Headers headers) {
        Log.i(tag, "onResponse..");
    }

    @Override
    public void onProgress(int progress, long networkSpeed, boolean done) {
        Log.i(tag, "onProgress..");
    }

    @Override
    public void onFinish() {
        Log.i(tag, "onFinish..");
    }
}
